import 'package:flutter/material.dart';
import 'package:flutter_project/moudle/root/tab_model.dart';
import 'package:get/get.dart';

class TabarLogic {
  final isShowTabar = true.obs;
  final currentIndex = 0.obs;
  PageController pageController = PageController();
  final tabs = [
    TabModel()
      ..icon = 'assets/images/tab_home_icon.png'
      ..title = '首页'
      ..selIcon = 'assets/images/tab_home_icon_checked.png',
    TabModel()
      ..icon = 'assets/images/tab_market_icon.png'
      ..title = '行情'
      ..selIcon = 'assets/images/tab_market_icon_checked.png',
    TabModel()
      ..icon = 'assets/images/tab_option_icon.png'
      ..title = '自选'
      ..selIcon = 'assets/images/tab_option_icon_checked.png',
    TabModel()
      ..icon = 'assets/images/tab_user_icon.png'
      ..title = '我的'
      ..selIcon = 'assets/images/tab_user_icon_checked.png',
  ];

  void switchTo(int index) {
    currentIndex.value = index;
    pageController.jumpToPage(index);
  }
}
